<?php include incTemplate('header.php'); ?>
<script type="text/javascript">
$(function(){
	$(".sp_btn").button();
	$(".sp_btn").click(function(){
		var username = getVal("username");
		var userpass = getVal("userpass");
		var rember = getAttr("rember","checked")=="checked"?1:0;

		$.post('admin.php/welcome/login',{username:username,userpass:userpass,rember:rember},function(data){
			if(data.type == 'error'){
				$(".tip").show();
				$("#msg").html(data.msg);
				$("#form").effect( 'shake', null, 500 );
			}else{
				$(".tip").hide();
				window.location.href="admin.php/welcome/console";
			}
		},'json');
		
	});
});
</script>
<style>
#login {
    margin: 7em auto;
    width: 320px;
}
form {
    background: none repeat scroll 0 0 #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 3px 3px 3px 3px;
    box-shadow: 0 4px 10px -1px rgba(200, 200, 200, 0.7);
    font-weight: normal;
    padding: 26px 24px 46px;
}
.f_12{font-size:12px;}
.f_14{font-size:14px;}
.f_13{font-size:13px;}
.input{
    background: none repeat scroll 0 0 #FBFBFB;
    border: 1px solid #E5E5E5;
    box-shadow: 1px 1px 2px rgba(200, 200, 200, 0.2) inset;
    font-family: "HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;
    font-size: 24px;
    font-weight: 200;
    margin-bottom: 16px;
    margin-right: 6px;
    margin-top: 2px;
    outline: medium none;
    padding: 3px;
    width: 97%;
}
label {
    color: #777777;
    font-size: 14px;
}
.tar{text-align:right;}
.fl{float:left;}
.tip{margin-bottom:20px;}
.hidden{display:none;}
</style>
</head>
	<body>
		<div id="login">
				<div class="ui-state-error ui-corner-all tip hidden"> 
				<p class="f_14">
				<span style="float: left; margin-left: 20px;margin-right:10px;" class="ui-icon ui-icon-alert "></span> 
				<span id="msg"></span>
				</p>
				</div>
			<form action="" id="form">
				<p>
				<label>
				用户名
				<br>
				<input type="text" class="input" id="username"/>
				</label>
				</p>
				<p>
				<label>
				密码
				<br>
				<input type="password" class="input" id="userpass"/>
				</label>
				</p>
				<p class="tar">
				<span class="fl">
				<label class="f_12">
				<input type="checkbox" checked="checked" id="rember" />记住我的登入信息
				</label>
				</span>
				<span class="sp_btn">登入</span>
				</p>
			</form>
		</div>			
	</body>
</html>
